\doxysection{v\+Task\+End\+Scheduler }
\hypertarget{group__v_task_end_scheduler}{}\label{group__v_task_end_scheduler}\index{vTaskEndScheduler@{vTaskEndScheduler}}
task. h 
\begin{DoxyPre}void vTaskEndScheduler( void );\end{DoxyPre}


NOTE\+: At the time of writing only the x86 real mode port, which runs on a PC in place of DOS, implements this function.

Stops the real time kernel tick. All created tasks will be automatically deleted and multitasking (either preemptive or cooperative) will stop. Execution then resumes from the point where v\+Task\+Start\+Scheduler () was called, as if v\+Task\+Start\+Scheduler () had just returned.

See the demo application file main. c in the demo/\+PC directory for an example that uses v\+Task\+End\+Scheduler ().

v\+Task\+End\+Scheduler () requires an exit function to be defined within the portable layer (see v\+Port\+End\+Scheduler () in port. c for the PC port). This performs hardware specific operations such as stopping the kernel tick.

v\+Task\+End\+Scheduler () will cause all of the resources allocated by the kernel to be freed -\/ but will not free resources allocated by application tasks.

Example usage\+: 
\begin{DoxyPre}
void vTaskCode( void * pvParameters )
\{
    for( ;; )
    \{
     // Task code goes here.

     // At some point we want to end the real time kernel processing
     // so call ...
     vTaskEndScheduler ();
    \}
\}

void vAFunction( void )
\{
    // Create at least one task before starting the kernel.
    xTaskCreate( vTaskCode, "{}NAME"{}, STACK\_SIZE, NULL, tskIDLE\_PRIORITY, NULL );

    // Start the real time kernel with preemption.
    vTaskStartScheduler ();

    // Will only get here when the vTaskCode () task has called
    // vTaskEndScheduler ().  When we get here we are back to single task
    // execution.
\}
  \end{DoxyPre}
 